package tech.aistar.corejava.day02;

/**
 * @author success
 * @version 1.0
 * @description:本类用来演示:char类型
 * @date 2019/7/16 0016
 */
public class CharDemo {
    public static void main(String[] args) {
        //char类型底层是采用unicode编码

        //byte->short->int->long
        //int->double
        //char - > int     ok
        String str = "abc";

        //char类型使用单引号包裹单个字符
        char c1 = '我';
        char c2 = 'a';
        char c3 = 'A';
        char c4 = '\n';
        char c5 = '\t';//一个tab键的距离

        //可以通过终端,输入native2ascii
        char c6 = '\u7ba1';//某个汉字的unicode编码
        char c7 = 65;

        char c8 = 97;

        char c9 = 48;

        System.out.println("c8:"+c8);

        System.out.println("c6:"+c6);
        System.out.println("c8:"+c8);//a

        System.out.println("c9:"+c9);

        //关于ascii码
        //字符'A'对应的ascii码是数字65
        //字符'a'对应的ascii码是数字97
        //字符'0'对应的ascii码是数字48
    }
}
